<include file="Public/header" />
<title>添加账册</title>
</head>
<body>
<div class="pd-20">
<form class="" name="form" id="form" action="__URL__/config/" method="get">
	<table class="table table-border table-bordered table-bg">
		<input type="hidden" name="id" class="input-text" value="<{$detail.id}>">
		<input type="hidden" value="<{:I('user_id')}>" name="user_id">
		<tbody>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">变量名称</td>
				<td class="text-l" width="85%">
					<input type="text" name="name" class="input-text" disabled value="<{$detail.name}>" >
				</td>
			</tr>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">英文名称</td>
				<td class="text-l">
					<input type="text" name="en_name" disabled class="input-text" value="<{$detail.en_name}>">
				</td>				
			</tr>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">值</td>
				<td class="text-l" width="85%">
					<textarea  class="textarea" name="value"><{$detail.value}></textarea>
				</td>				
			</tr>
		</tbody>
	</table>
	<input type="button" class="btn btn-primary radius mt" id="b_add" value="更新">
</form>
</div>
<script type="text/javascript">
    $(function(){
		/*保存计划入库单数据*/
        $("#b_add").click(function(){
			name=$('input[name=name]').val();
			en_name=$('input[name=en_name]').val();
			value=$('textarea[name=value]').val();
			$.ajax({
                type: 'POST',
                data: {name:name,en_name:en_name,value:value,user_id:<{:I('user_id')}>},
                url: "<{:U('editD_config')}>",
                success:function(msg){
					msg=eval("("+msg+")");
                    layer.msg(msg.data,function(){
						if(msg.flag==0){
							return false;
						}
						parent.window.location.href =parent.window.location.href;
					});
                }
            })
            
        });

    })
</script>
</body>
</html>